﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using uzing;


namespace example_shared_memory
{
    class Program
    {
        static void Main(string[] args)
        {
            string memName = "abcdefg";
            CSharedMemory shrdMem = new CSharedMemory(ref memName, 1024);

            ASCIIEncoding encoder = new ASCIIEncoding();
            byte[] buf = new byte[512];
            while (true)
            {
                shrdMem.ReadMemory(buf, 100, 0);
                System.Console.WriteLine(encoder.GetString(buf, 0, 15));
                shrdMem.ReadMemory(buf, 100, 200);
                System.Console.WriteLine(encoder.GetString(buf, 0, 40));
                System.Threading.Thread.Sleep(100);
            }
        }
    }
}
